import request from '@/utils/request'
import cache from "@/plugins/cache";
import Cookies from "js-cookie";

// 查询设备采集配置列表
export function listDlldrinfo(query) {
  return request({
    url: '/system/dlldrinfo/list',
    method: 'get',
    params: query
  })
}

// 查询接口驱动结构
export function drllNameSelect() {
  return request({
    url: '/system/dlldrinfo/listAll',
    method: 'get'
  })
}

// 查询驱动类型
/*export function drllTypeSelect() {
  return request({
    url: '/system/dict/data/typeTwo/sys_dll_type',
    method: 'get'
  })
}*/

// 查询设备采集配置详细
export function getDlldrinfo(drid) {
  return request({
    url: '/system/dlldrinfo/' + drid,
    method: 'get'
  })
}

// 新增设备采集配置
export function addDlldrinfo(data) {
  return request({
    url: '/system/dlldrinfo',
    method: 'post',
    data: data
  })
}

// 修改设备采集配置
export function updateDlldrinfo(data) {
  return request({
    url: '/system/dlldrinfo',
    method: 'put',
    data: data
  })
}

// 删除设备采集配置
export function delDlldrinfo(drid) {
  return request({
    url: '/system/dlldrinfo/' + drid,
    method: 'delete'
  })
}

export function getDbName() {
  return cache.local.get("currentProject");
}

